//
//  SQLiteHelper.h
//  SQLiteHelper
//
//  Created by Ryou Zhang on 8/30/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

@class FMDatabase;
@class FMResultSet;

@interface SQLiteHelper : NSObject
{
@private
	FMDatabase*		db;
	NSThread*		dbMoniter;
	BOOL			threadFlag;
}

+(SQLiteHelper *)getInstance;

-(BOOL)openDatabase:(NSString*)dbPath;
-(void)closeDatabase;

-(FMResultSet*)syncExecuteQuery:(NSString*)sql;
-(FMResultSet*)syncExecuteQuery:(NSString *)sql withArgumentsInArray:(NSArray *)arguments;

-(void)asynExecuteUpdate:(NSString*)sql;
-(void)asynExecuteUpdate:(NSString*)sql withArgumentsInArray:(NSArray *)arguments;

-(BOOL)syncExecuteUpdate:(NSString*)sql;
-(BOOL)syncExecuteUpdate:(NSString*)sql withArgumentsInArray:(NSArray *)arguments;
@end
